#include "menoitem.h"
#include <QPainter>
#include "global/globalvar.h"
#include "commondef.h"

MenoItem::MenoItem()
{
}

void MenoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
//    painter->save();

    QPainterPath roundpath;
    roundpath.addRoundRect(0.0f,0.0f,120.0f,40.0f,80);
    QColor color(globalvar::m_logic.m_bmeno ? POS_PROMPT_MENO : POS_PROMPT_NOMENO);
    painter->fillPath(roundpath,QBrush(color));

    QPen p(CHESSANSWER_COLOR);
    painter->setPen(p);
    painter->drawText(QRectF(0.0f,0.0f,120.0f,40.0f),
                      Qt::AlignCenter,
                      QString(tr("meno")));

//    painter->restore();
}

QRectF MenoItem::boundingRect() const
{
    return QRectF(0.0f,0.0f,120.0f,40.0f);
}
